package com.mh.shiro.business.enums;

/**
 * @Author: E-mail:
 * @Version: 创建时间：2019年06月21日11:09
 * @Description: <描述>
 */
public enum  UserStatusEnum {
    NORMAL(1,"正常"),
    DISABLE(0,"禁用");

    private Integer code;
    private String desc;

    UserStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public static UserStatusEnum get(Integer code) {
        if(null == code) {
            return NORMAL;
        }
        UserStatusEnum[] enums = UserStatusEnum.values();
        for(UserStatusEnum anEnum : enums) {
            if(anEnum.getCode().equals(code)) {
                return anEnum;
            }
        }
        return NORMAL;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }}
